package com.company.class5;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @Classname HomeWork
 * @Description 类型说明
 * @Date 2022/4/18 23:38
 * @Created by zbw
 */

public class HomeWork {
    public static void main(String[] args) {
        String[][] a = new String[9][9];
        for(int i=1;i<=9;i++){
            for(int j=1;j<=9;j++){
                a[i-1][j-1] = i+"*"+j+"="+i*j+"\t";
//                System.out.print(a[i-1][j-1]);
            }
//            System.out.println();
        }
        for(String[] strings:a){
            //输出一维数组
            for(String string:strings){
                System.out.print(string);
            }
            //换行
            System.out.println();
        }
        System.out.println("---------------------------------------------------------------------");

        //定义一个长度为10的数组
        int[] x = new int[10];
        //填满
        Arrays.fill(x,3);
        //修改
        x[4] = 5;
        x[6] = 2;
        x[8] = 4;
        //输出数组
        System.out.println("Arrays.toString(x)="+Arrays.toString(x));
        //排序
        Arrays.sort(x);
        System.out.println("for下标循环:");
        //for下标循环
        for(int i = 0;i<x.length;i++){
            System.out.print(x[i]+",");
        }
        System.out.println();
        System.out.println("foreach循环:");
        //foreach循环
        for (int i:x
             ) {
            System.out.print(i+",");
        }



    }
}
